<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    info: { type: Object, required: true },
  },
});
</script>

<template>
  <view class="course-item">
    <image class="course-item-img" :src="info.pic_url" lazy-load />
    <view class="course-item-content">
      <view class="course-item-name">{{ info.title }}</view>
    </view>
  </view>
</template>

<style lang="scss">
.course-item {
  display: flex;
  align-items: flex-start;
  padding: 20rpx;
  border-radius: 20rpx;
  background-color: #ffffff;

  .course-item-img {
    flex-shrink: 0;
    width: 144rpx;
    height: 108rpx;
    border-radius: 10rpx;
  }

  .course-item-content {
    flex-grow: 1;
    min-width: 0;
    margin-left: 20rpx;
  }

  .course-item-name {
    height: 72rpx;
    margin-bottom: 6rpx;
    font-size: 26rpx;
    color: #333333;
    line-height: 36rpx;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-overflow: ellipsis;
    overflow: hidden;
  }
}
</style>